<?php
 /*********************************************\
 |* @author Yannic Schnetz, Mike Waldvogel    *|
 |* @copyright Yannic Schnetz, Mike Waldvogel *|
 |*********************************************|
 |* @since 30.07.2013                         *|
 \*********************************************/

class Group {
    
    public static function get_foodgroup_by_id($id) {
        global $DB;
        
        $q = $DB->query("SELECT `name` FROM `speisegruppen` WHERE `id` = '" . $id . "'");
        $f = $DB->fetch($q);
        
        return $f['name'];
    }
    
    public static function get_group_by_id($id) {
        global $DB;
        
        $q = $DB->query("SELECT `name` FROM `preisgruppen` WHERE `id` = '" . $id . "'");
        $f = $DB->fetch($q);
        
        return $f['name'];
    }
    
    public static function get_groupid_by_name($name) {
        global $DB;
        
        $q = $DB->query("SELECT `id` FROM `preisgruppen` WHERE `name` = '" . $name . "'");
        $f = $DB->fetch($q);
        
        return $f['id'];
    }
    
}
?>
